<?php
namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class TcmBookCollect extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'tcm_book_collect';

    protected $primaryKey = 'id';

    public $timestamps = false;

    protected $fillable = [
        'book_id', // 书籍ID
        'member_id', // 用户ID
        'history_book_chapter_id', // 已读历史章节ID
    ];

    public function book()
    {
        return $this->belongsTo(TcmBook::class, 'book_id');
    }
}
